/*
 * Copyright © 2022
 * @Author: zhangxiang
 * @Date: 2022-11-22 09:50:44
 * @LastEditors: 976901273@qq.com
 * @LastEditTime: 2023-09-26 10:02:47
 * @Description:
 *
 */

import request from '@/utils/request'

/**
 * @description: 获取算网列表
 * @param {*} data
 * @return {*}
 */
export function getCloudList(data) {
  return request({
    url: '/api/cloud/list',
    method: 'post',
    data
  })
}

/**
 * @description: 算网同步
 * @param {*} data
 * @return {*}
 */
export function syncCloud(data) {
  return request({
    url: '/api/cloud/sync',
    method: 'post',
    data,
    timeout: 5 * 60000 // 5分钟超时
  })
}

/**
 * @description: 删除算网
 * @param {*} params
 * @return {*}
 */
export function deleteCloud(data) {
  return request({
    url: '/api/cloud/delete',
    method: 'post',
    data
  })
}

/**
 * @description: 获取公有云凭据列表
 * @param {*} data
 * @return {*}
 */
export function getPublicTokenList(data) {
  return request({
    url: '/api/account/public/list',
    method: 'post',
    data
  })
}

/**
 * @description: 创建公有云凭据
 * @param {*} data
 * @return {*}
 */
export function createPublicToken(data) {
  return request({
    url: '/api/account/public/create',
    method: 'post',
    data
  })
}

/**
 * @description: 删除公有云凭据
 * @param {*} data
 * @return {*}
 */
export function deletePublicToken(data) {
  return request({
    url: '/api/account/public/delete',
    method: 'post',
    data
  })
}

/**
 * @description: 获取私有云账号列表
 * @param {*} data
 * @return {*}
 */
export function getPrivateAccountList(data) {
  return request({
    url: '/api/account/private/list',
    method: 'post',
    data
  })
}

/**
 * @description: 创建私有云账号
 * @param {*} data
 * @return {*}
 */
export function createPrivateAccount(data) {
  return request({
    url: '/api/account/private/create',
    method: 'post',
    data
  })
}

/**
 * @description: 编辑私有云账号
 * @param {*} data
 * @return {*}
 */
export function updatePrivateAccount(data) {
  return request({
    url: '/api/account/private/update',
    method: 'post',
    data
  })
}

/**
 * @description: 删除私有云账号
 * @param {*} data
 * @return {*}
 */
export function deletePrivateAccount(data) {
  return request({
    url: '/api/account/private/delete',
    method: 'post',
    data
  })
}

/**
 * @description: 查询物理机列表
 * @param {*} data
 * @return {*}
 */
export function getPmList(data) {
  return request({
    url: '/api/monitor/pm/list',
    method: 'post',
    data
  })
}
